import 'package:myturngame/bean/role_in_combat.dart';
import 'package:myturngame/bean/skill/skill.dart';

///战斗中执行的行为
abstract class CombatAction {
  RoleInCombat from;

  String name;

  CombatAction(this.from, this.name);
}

///有目标的行为
abstract class HasTargetAction extends CombatAction {
  RoleInCombat target;

  HasTargetAction(super.from, this.target, super.name);
}

///攻击行为
class AttackAction extends HasTargetAction {
  AttackAction(RoleInCombat from, RoleInCombat target)
      : super(from, target, '攻击');
}

///技能行为
class SkillAction extends HasTargetAction {
  Skill skill;

  SkillAction(RoleInCombat from, RoleInCombat target, this.skill)
      : super(from, target, skill.name);
}
